package vo;

import entity.Course;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class CourseVo extends Course {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date begin_date;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date end_date;

    private Integer pageNo;
    private Integer pageSize;
    private Integer course_type_id;

    public Integer getCourse_type_id() {
        return course_type_id;
    }

    public void setCourse_type_id(Integer course_type_id) {
        this.course_type_id = course_type_id;
    }

    public Date getBegin_date() {
        return begin_date;
    }

    public void setBegin_date(Date begin_date) {
        this.begin_date = begin_date;
    }

    public Date getEnd_date() {
        return end_date;
    }

    public void setEnd_date(Date end_date) {
        this.end_date = end_date;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public CourseVo() {
    }

    public CourseVo(Course course,Integer course_type_id) {
        super.setId(course.getId());
        super.setCourse_name(course.getCourse_name());
        super.setAuthor(course.getAuthor());
        super.setCover_image_url(course.getCover_image_url());
        super.setCreate_date(course.getCreate_date());
        super.setCreate_datestr(course.getCreate_datestr());
        super.setEnd_datestr(course.getEnd_datestr());
        super.setClick_number(course.getClick_number());
        super.setStatus(course.getStatus());
        super.setRecommendation_grade(course.getRecommendation_grade());
        super.setCourseType(course.getCourseType());
        this.course_type_id = course_type_id;
    }
}
